package com.barunsw.bwf.ems.neoarena.ne;

import org.omg.CORBA.StringHolder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import NAS.NASIf;
import NAS.req_cmd_st;
import NAS.res_cmd_st_seqHolder;

@Service
public class NasServiceImpl implements NasService {
	private static final Logger LOGGER = LoggerFactory.getLogger(NasServiceImpl.class);

	@Autowired
	NASIfManager nasIfManager;
	
	@Override
	public void requestCmd(long nodeId, 
			req_cmd_st var_req_cmd_st, 
			res_cmd_st_seqHolder res_mms_meta_info_list, 
			StringHolder reason) throws Exception {
		LOGGER.debug(String.format("nodeId:%s, cmd:%s", nodeId, var_req_cmd_st.cmd));
		
		NASIf nasIf = nasIfManager.getNASIf(nodeId);
		
		if ( nasIf != null ) {
			nasIf.request_meta(var_req_cmd_st, res_mms_meta_info_list, reason);
		}
	}
}
